package org.example.shop.web;

import org.example.shop.pojo.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("order-service-provider")
@Component
public interface IOrderController {
    /**
     * 创建订单
     * @param order
     * @return
     */
    @RequestMapping("/order/create")
    Order createOrder(Order order);

    /**
     * 查询订单
     * @param id
     * @return
     */
    @PostMapping("/order/query")
    Order queryOrder(@RequestParam("id") Long id);
}
